package com.metadata_system.common.db.entity;

import java.util.Date;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Table(name = "md_metadata_edge")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class MetadataEdge {
    @Id
    private Integer id;

    /**
     * 元数据ID
     */
    @Column(name = "metadata_id")
    private Integer metadataId;

    /**
     * 元数据视图ID
     */
    @Column(name = "metadata_view_id")
    private Integer metadataViewId;

    /**
     * 元素-名称
     */
    private String name;

    /**
     * 唯一标识(复用元素)
     */
    @Column(name = "unique_key")
    private String uniqueKey;

    /**
     * 源节点-ID
     */
    private Integer source;

    /**
     * 源节点-连线位置
     */
    @Column(name = "source_handle")
    private String sourceHandle;

    /**
     * 目标节点-ID
     */
    private Integer target;

    /**
     * 目标节点-连线位置
     */
    @Column(name = "target_handle")
    private String targetHandle;

    /**
     * 线段类型
     */
    private Integer type;

    /**
     * 属性数据
     */
    private String properties;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createdTime;

    /**
     * 更新时间
     */
    @Column(name = "updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updatedTime;
}